// 初始化
function initPage(currentPage, limit) {
    var html = ``
    for(var i = 0; i < listArr.length; i++){
        listArr[i].id = i + 1
        if(i >= (currentPage-1) * limit && i < currentPage * limit) {
            html += `
            <div class="article"">
                <h4>${listArr[i].title + ' ' + listArr[i].id}</h4>

                <div class="author">
                    <span class="mar-r-20">作者：${listArr[i].author}</span>
                    <span class="mar-r-20">创建时间：${listArr[i].createTime}</span>
                    <span class="mar-r-20">阅读：${listArr[i].readCount}</span>
                    <span>评论：${listArr[i].commentCount}</span>
                </div>
                ${listArr[i].content}
                <div class="flex bg-50a5ff color-white w-px-80 font-12 align-center justify-center pad-y-5 bor-radius-3 mar-t-20">
                    <img src="./images/icon_005.png" class="w-px-14 mar-r-2"/>
                    <span>阅读全文</span>
                </div>
            </div>`
        }
    }

    var listDom = document.getElementById('list')

    listDom.innerHTML = html
}